public class calculator
 {
	int add(int a,int b)
	{
		return(a+b);
	}
	float add(float a,float b)
	{
	return(a+b);
	}
	double add(double a,double b)
	{
		return(a+b);
	}
	double areaOfArectangle(double h,double w)
	{
		return(h*w);
	}
	double areaOfAcircle(double r)
	{
		return(r*r*3.14);
	}
	
	public static int[] generatefibonacci(int num)
	{
		int[] fib=new int[num];
		fib[0]=0;
		fib[1]=1;
		for(int i=2;i<fib.length;i++)
		{
			fib[i]=fib[i-1]+fib[i-2];
		}
		return(fib);
	}
	
	public static int linearSearch(int[] arr, int key)
 {
	int pos=-1;
	for(int i=0;i<arr.length;i++)
	if(arr[i]==key)
	pos=i+1;
	return pos;
}
public static int binarySearch(int[] arr, int key)
 {
	int pos=-1;
	int low = 0;	
	int high = arr.length-1;
	int mid=(low+high)/2;	
	while(low <= high)
	{
	mid=(low+high)/2;		
	if(key < arr[mid])
	high = mid - 1;
	else if(key > arr[mid])
	low = mid + 1;
	else 
	{
	pos = mid+1;
	break;
	}			
	}
	return pos;		
}

}